package org.zxl.iotest.netty.protobuf.server;

import io.netty.channel.Channel;

/**
 * @author zhangxiaolong
 * @date 2025-02-16 17:07
 **/

public class Client {

    private String channelId;

    private Long clientUuid;

    private Channel channel;

    /**
     * 心跳时间
     */
    private Long heartBeatTime;


    public String getChannelId() {
        return channelId;
    }

    public void setChannelId(String channelId) {
        this.channelId = channelId;
    }

    public Long getClientUuid() {
        return clientUuid;
    }

    public void setClientUuid(Long clientUuid) {
        this.clientUuid = clientUuid;
        this.heartBeatTime = System.currentTimeMillis();
    }

    public Channel getChannel() {
        return channel;
    }

    public void setChannel(Channel channel) {
        this.channel = channel;
    }

    public Long getHeartBeatTime() {
        return heartBeatTime;
    }

    public void setHeartBeatTime(Long heartBeatTime) {
        this.heartBeatTime = heartBeatTime;
    }

    public Client() {
    }

    public Client(String channelId, Channel channel) {
        this.channelId = channelId;
        this.channel = channel;
        this.heartBeatTime = System.currentTimeMillis();
    }

    public void refreshHeartBeatTime(){
        this.heartBeatTime = System.currentTimeMillis();
    }
}
